<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>Title</title>
    <link rel="stylesheet" href="/static/layui/css/layui.css">
    <link rel="stylesheet" href="/static/weadmin/css/we.css">
</head>
<body class="unibody">
<div class="layui-row">
    <div class="layui-col-md12">
        <blockquote class="layui-elem-quote layui-quote-nm">
            <div class="layui-row">
                <div class="layui-col-md1 layui-col-sm2">
                    <a class="layui-btn layui-btn-normal role-add"><i class="layui-icon">&#xe608;</i>添加</a>
                </div>
            </div>
        </blockquote>
    </div>
    <hr class="layui-bg-blue">
    <div class="layui-col-md12">
        <table class="layui-table">
            <colgroup>
                <col width="30">
                <col><col><col><col><col>
                <col width="180">
            </colgroup>
            <thead>
            <tr>
                <th>ID</th>
                <th>角色名称</th>
                <th>角色英文名</th>
                <th>状态</th>
                <th>角色类型</th>
                <th>创建时间</th>
                <th>更新时间</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            {{foreach name="list" item="vo"}}
                <tr>
                    <td>{{$vo.id}}</td>
                    <td>{{$vo.name}}</td>
                    <td>{{$vo.ename}}</td>
                    <td>{{$vo.usable}}</td>
                    <td>{{$vo.role_type}}</td>
                    <td>{{$vo.created_at}}</td>
                    <td>{{$vo.updated_at}}</td>
                    <td align="center">
                        <a class="layui-btn layui-btn-xs power" id="{{$vo.id}}">权限分配</a>
                        <a class="layui-btn layui-btn-xs edit" id="{{$vo.id}}">编辑</a>
                        <a class="layui-btn layui-btn-danger layui-btn-xs del" id="{{$vo.id}}">删除</a>
                    </td>
                </tr>
            {{/foreach}}
            </tbody>
        </table>
    </div>
</div>
<script src="/static/layui/layui.all.js"></script>
<script src="/static/weadmin/js/admin/role/role.js"></script>

<link rel="stylesheet" href="/static/plugins/zTreeStyle/zTreeStyle.css" type="text/css">
<script type="text/javascript" src="/static/plugins/zTree_v3/js/jquery.ztree.core.js"></script>
<script type="text/javascript" src="/static/plugins/zTree_v3/js/jquery.ztree.excheck.js"></script>
<script type="text/javascript" src="/static/plugins/zTree_v3/js/jquery.ztree.exedit.js"></script>
</body>
<!-- 添加页 -->
<div class="lay-row role-from" hidden>
    <hr>
    <div class="layui-col-md11">
        <form class="layui-form" action="">
            <input type="hidden" name="id" value="">
            <div class="layui-form-item">
                <label class="layui-form-label">角色名称</label>
                <div class="layui-input-block">
                    <input type="text" name="name" required  lay-verify="required" placeholder="请输入角色名称" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">角色英文名</label>
                <div class="layui-input-block">
                    <input type="text" name="ename" required  lay-verify="required" placeholder="请输入角色英文名" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">状态</label>
                <div class="layui-input-block">
                    <input type="checkbox" name="usable" lay-skin="switch" lay-text="开|关" checked>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">角色类型</label>
                <div class="layui-input-block">
                    <select class="sel" name="role_type" required lay-verify="required">
                        <option value=""></option>
                        <option value="object">系统权限</option>
                        <option value="user">用户权限</option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">角色简介</label>
                <div class="layui-input-block">
                    <input type="text" name="display_name" required placeholder="请输入角色英简介" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">角色备注</label>
                <div class="layui-input-block">
                    <textarea name="description" placeholder="请输入备注信息" class="layui-textarea"></textarea>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit lay-filter="formRole">立即提交</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </div>
            </div>
        </form>
    </div>
    <hr>
</div>

<!-- 修改页 -->
<div class="lay-row role-edit" hidden>
    <hr>
    <div class="layui-col-md11">
        <form class="layui-form" action="">
            <input type="hidden" name="id" id="id-edit" value="">
            <div class="layui-form-item">
                <label class="layui-form-label">角色名称</label>
                <div class="layui-input-block">
                    <input type="text" name="name" id="name-edit" required  lay-verify="required" placeholder="请输入角色名称" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">角色英文名</label>
                <div class="layui-input-block">
                    <input type="text" name="ename" id="ename-edit" required  lay-verify="required" placeholder="请输入角色英文名" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">状态</label>
                <div class="layui-input-block">
                    <input type="checkbox" name="usable" id="usable-edit" lay-skin="switch" lay-text="开|关" checked>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">角色类型</label>
                <div class="layui-input-block">
                    <select class="sel" name="role_type" id="sel-edit" lay-verify="required">
                        <option value=""></option>
                        <option value="object">系统权限</option>
                        <option value="people">用户权限</option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">角色简介</label>
                <div class="layui-input-block">
                    <input type="text" name="display_name" id="display-edit" required placeholder="请输入角色英简介" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">角色备注</label>
                <div class="layui-input-block">
                    <textarea name="description" id="description-edit" placeholder="请输入备注信息" class="layui-textarea"></textarea>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit lay-filter="formRoleEdit">立即提交</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </div>
            </div>
        </form>
    </div>
    <hr>
</div>

<!-- 权限分配页 -->
<div class="lay-row role-power" hidden>
    <hr>
        <div class="layui-col-md11">
            <form class="layui-form" action="">
                <input type="hidden" name="id" id="id-power" value="">
                <div class="layui-form-item">
                    <ul id="treeType" class="ztree"></ul>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <!--<a class="layui-btn layui-btn-xs postpower" id="postpower">权限分配</a>-->
                        <button class="layui-btn" lay-submit lay-filter="formPower">确认分配</button>
                        <!--<input type="button" value="确认分配" class="layui-btn" id="postpower"/>-->
                        <!--<a class="layui-btn layui-btn postpower" id="postpower">确认</a>-->
                    </div>
                </div>
            </form>
        </div>
    <hr>
</div>
</html>